﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace mm
{
    class SumUtils
    {
        //计算两个整数相加
        /// <summary>
        /// 两个数的和
        /// </summary>
        /// <param name="a">第一个数</param>
        /// <param name="b">第二个数</param>
        /// <returns></returns>
        public int Sum(int a, int b)
        {
            return a + b;
        }
        //两个小数相加
        public double Sum(double a, double b)
        {
            return a + b;
        }
        //两个字符串相加
        public string Sum(string a, string b)
        {
            return a + b;
        }
        //以及从 1 到指定整数的和的方法
        public int Sum(int a)
        {
            int sum = 0;
            for (int i = 1; i <= a; i++)
            {
                sum += i;
            }
            return sum;
        }
        public SumUtils()
        {

        }
    }
}
